import pandas as pd
import sys
from numpy import isnan
try:
    sheet = pd.read_excel("/Users/wangshuguan/Desktop/2019签约比对/新农合/翠云路参加新农合签约名单.xls", 'Sheet1', index_col=None, na_values=['NA'], header=1)
    sheet2 = pd.read_excel("/Users/wangshuguan/Desktop/翠云路参加新农合签约名单.xlsx", 'Sheet1', index_col=None, na_values=['NA'], header=1)
except IOError:
    print("无法打开文件")
    sys.exit()
sheet1array = sheet.to_numpy()
sheet2array = sheet2.to_numpy()
for i,x in enumerate(sheet1array):
    for j,y in enumerate(x):
#         print(f"{type(sheet1array[i][j])},{type(sheet2array[i][j])}")
        if sheet1array[i][j] == sheet2array[i][j]:
            pass
        else:
            if isnan(sheet1array[i][j]) and isnan(sheet2array[i][j]):
                pass
            else:
                print(f"{sheet1array[i][j]},{sheet2array[i][j]}---{sheet1array[i][j]},{sheet2array[i][j]}")
print("over")
# print(sheet.diff(sheet2))
# print(sheet2array[0][0])
# print(f"{sheet1array[0][1]},{sheet2array[0][1]}")
# print(f"{type(sheet1array[0][1])},{type(sheet2array[0][1])}")